﻿<?xml version="1.0" encoding="utf-8"?><Articles><Article><ArticlesID>937</ArticlesID><Title>Chạy Web Domain ảo tr&amp;#234;n Windows</Title><Body>&amp;lt;p&amp;gt;Bạn đang cần một Domain để Test thay v&amp;amp;igrave; d&amp;amp;ugrave;ng http://localhost ?&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;Bạn kh&amp;amp;ocirc;ng muốn phải tốn $ thu&amp;amp;ecirc; Hosting hay t&amp;amp;ecirc;n miền để test khi chưa public ?&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;Chỉ cần l&amp;amp;agrave;m c&amp;amp;aacute;c bước đơn giản sau đ&amp;amp;acirc;y bạn sẽ c&amp;amp;oacute; 1 domain (chạy tr&amp;amp;ecirc;n m&amp;amp;aacute;y bạn) + website chạy ngon l&amp;amp;agrave;nh kh&amp;amp;ocirc;ng cần phải d&amp;amp;ugrave;ng đến http://localhost/&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;&amp;lt;span style=&amp;quot;font-size: x-large;&amp;quot;&amp;gt;&amp;lt;a name=&amp;quot;Windows2003&amp;quot;&amp;gt;Đối với Windows Server 2003&amp;lt;/a&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;&amp;lt;span style=&amp;quot;font-size: large;&amp;quot;&amp;gt;&amp;lt;a name=&amp;quot;B1_2003&amp;quot;&amp;gt;B1: V&amp;amp;agrave;o Folder&amp;amp;nbsp;C:\WINDOWS\system32\drivers\etc mở file Host bằng Notepad hoặc Notepad++&amp;lt;/a&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;Ở đ&amp;amp;acirc;y bạn sẽ thấy ngay 1 d&amp;amp;ograve;ng thế n&amp;amp;agrave;y&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;127.0.0.1 &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;lt;span style=&amp;quot;white-space: pre;&amp;quot; class=&amp;quot;Apple-tab-span&amp;quot;&amp;gt;	&amp;lt;/span&amp;gt;localhost&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;Enter xuống dưới bạn g&amp;amp;otilde; th&amp;amp;ecirc;m t&amp;amp;ecirc;n domain bạn muốn đặt:&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;127.0.0.1 &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp;&amp;lt;strong&amp;gt;www.ten_domain_cua_ban.com&amp;lt;/strong&amp;gt; (ở đ&amp;amp;acirc;y m&amp;amp;igrave;nh để l&amp;amp;agrave; www.test.com)&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;&amp;lt;img width=&amp;quot;427&amp;quot; height=&amp;quot;98&amp;quot; src=&amp;quot;http://dev.meotom.net/Uploads/admin/2010/6/14/ScreenHunter_001.gif&amp;quot; alt=&amp;quot;&amp;quot; /&amp;gt;&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;&amp;lt;span style=&amp;quot;font-size: large;&amp;quot;&amp;gt;B2: V&amp;amp;agrave;o IIS: Start --&amp;amp;gt; Run --&amp;amp;gt; inetmgr --&amp;amp;gt; Enter&amp;lt;/span&amp;gt;&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;Click chuột phải v&amp;amp;agrave;o Website --&amp;amp;gt; New --&amp;amp;gt; Website --&amp;amp;gt; Next --&amp;amp;gt; G&amp;amp;otilde; Description cho Website (vd: Test)&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;&amp;lt;img width=&amp;quot;552&amp;quot; height=&amp;quot;490&amp;quot; src=&amp;quot;http://dev.meotom.net/Uploads/admin/2010/6/14/ScreenHunter_002.gif&amp;quot; alt=&amp;quot;&amp;quot; /&amp;gt;&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;Click Next --&amp;amp;gt; Enter the IP address to use ... &amp;lt;strong&amp;gt;bạn để l&amp;amp;agrave; (All Unassigned) --&amp;amp;gt; TCP Port --&amp;amp;gt; 80&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;Host Header for this website: h&amp;amp;atilde;y g&amp;amp;otilde; t&amp;amp;ecirc;n website bạn tạo ở B1 v&amp;amp;agrave;o đ&amp;amp;acirc;y&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;&amp;lt;img width=&amp;quot;482&amp;quot; height=&amp;quot;373&amp;quot; src=&amp;quot;http://dev.meotom.net/Uploads/admin/2010/6/14/ScreenHunter_003.gif&amp;quot; alt=&amp;quot;&amp;quot; /&amp;gt;&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;Sau đ&amp;amp;oacute; Click Next&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;&amp;lt;img width=&amp;quot;483&amp;quot; height=&amp;quot;372&amp;quot; src=&amp;quot;http://dev.meotom.net/Uploads/admin/2010/6/14/ScreenHunter_004.gif&amp;quot; alt=&amp;quot;&amp;quot; /&amp;gt;&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;Tại Path bạn h&amp;amp;atilde;y Browse để Folder chứa Website của bạn. Click Next để tiếp tục&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;&amp;lt;img width=&amp;quot;472&amp;quot; height=&amp;quot;371&amp;quot; src=&amp;quot;http://dev.meotom.net/Uploads/admin/2010/6/14/ScreenHunter_015.gif&amp;quot; alt=&amp;quot;&amp;quot; /&amp;gt;&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;Click Next&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;&amp;lt;img width=&amp;quot;480&amp;quot; height=&amp;quot;374&amp;quot; src=&amp;quot;http://dev.meotom.net/Uploads/admin/2010/6/14/ScreenHunter_006.gif&amp;quot; alt=&amp;quot;&amp;quot; /&amp;gt;&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;Click Finish l&amp;amp;agrave; bạn đ&amp;amp;atilde; ho&amp;amp;agrave;n th&amp;amp;agrave;nh xong bước tạo Website cho IIS&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;&amp;lt;img width=&amp;quot;350&amp;quot; height=&amp;quot;258&amp;quot; src=&amp;quot;http://dev.meotom.net/Uploads/admin/2010/6/14/ScreenHunter_007.gif&amp;quot; alt=&amp;quot;&amp;quot; /&amp;gt;&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;B3: Chạy thử: bật Browser l&amp;amp;ecirc;n v&amp;amp;agrave; g&amp;amp;otilde; tr&amp;amp;ecirc;n thanh Address địa chỉ Website bạn vừa tạo ở B1 v&amp;amp;agrave; Enter&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;&amp;lt;img width=&amp;quot;460&amp;quot; height=&amp;quot;187&amp;quot; src=&amp;quot;http://dev.meotom.net/Uploads/admin/2010/6/14/ScreenHunter_008.gif&amp;quot; alt=&amp;quot;&amp;quot; /&amp;gt;&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;V&amp;amp;agrave; đ&amp;amp;acirc;y l&amp;amp;agrave; kết quả&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;&amp;lt;img width=&amp;quot;324&amp;quot; height=&amp;quot;202&amp;quot; src=&amp;quot;http://dev.meotom.net/Uploads/admin/2010/6/14/ScreenHunter_012.gif&amp;quot; alt=&amp;quot;&amp;quot; /&amp;gt;&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;Như vậy l&amp;amp;agrave; bạn đ&amp;amp;atilde; c&amp;amp;oacute; ngay 1 domain www.test.com để chạy Local&amp;amp;nbsp;&amp;lt;img src=&amp;quot;http://dev.meotom.net/Library/Editor/fckeditor/editor/images/smiley/yahoo/21.gif&amp;quot; alt=&amp;quot;&amp;quot; /&amp;gt;&amp;amp;nbsp;qu&amp;amp;aacute; dễ d&amp;amp;agrave;ng phải kh&amp;amp;ocirc;ng ?&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;Nếu bạn bị lỗi &amp;lt;strong&amp;gt;The page cannot be displayed&amp;lt;/strong&amp;gt; th&amp;amp;igrave; c&amp;amp;oacute; thể như sau:&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;1. Kiểm tra xem t&amp;amp;ecirc;n miền www.test.com đ&amp;amp;atilde; được trỏ đ&amp;amp;uacute;ng chưa ?&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;&amp;lt;img width=&amp;quot;488&amp;quot; height=&amp;quot;234&amp;quot; src=&amp;quot;http://dev.meotom.net/Uploads/admin/2010/6/14/ScreenHunter_013.gif&amp;quot; alt=&amp;quot;&amp;quot; /&amp;gt;&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;Thế n&amp;amp;agrave;y l&amp;amp;agrave; ch&amp;amp;iacute;nh x&amp;amp;aacute;c!!&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;2. Nếu reply trả về 1 IP kh&amp;amp;aacute;c th&amp;amp;igrave; bạn phải xem lại B1.&amp;amp;nbsp;&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;Vẫn kh&amp;amp;ocirc;ng được ? H&amp;amp;atilde;y Restart lại Browser của bạn để n&amp;amp;oacute; c&amp;amp;oacute; thể hiểu t&amp;amp;ecirc;n miền www.test.com đ&amp;amp;atilde; được trỏ về IP kh&amp;amp;aacute;c.&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;Vẫn kh&amp;amp;ocirc;ng được ? H&amp;amp;atilde;y Restart&amp;amp;nbsp;PC của bạn v&amp;amp;agrave; thử lại.&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;3. Nếu bạn đang truy cập Internet qua 1 Proxy n&amp;amp;agrave;o đ&amp;amp;oacute; th&amp;amp;igrave; h&amp;amp;atilde;y Bypass c&amp;amp;aacute;i domain www.test.com để n&amp;amp;oacute; hiểu domain www.test.com của bạn l&amp;amp;agrave; Local&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;&amp;lt;img width=&amp;quot;403&amp;quot; height=&amp;quot;515&amp;quot; src=&amp;quot;http://dev.meotom.net/Uploads/admin/2010/6/14/ScreenHunter_014.gif&amp;quot; alt=&amp;quot;&amp;quot; /&amp;gt;&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;4. Nếu bạn kh&amp;amp;ocirc;ng chạy được File *.asp th&amp;amp;igrave; rất c&amp;amp;oacute; thể IIS của bạn chưa được c&amp;amp;agrave;i ASP&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;Start --&amp;amp;gt; Run --&amp;amp;gt; appwiz.cpl --&amp;amp;gt; Enter --&amp;amp;gt; Chọn Tab Add/Remove Windows Components (h&amp;amp;atilde;y chuẩn bị sẵn 1 CD HĐH Windows Server 2003 ở trong ổ CD)&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;&amp;lt;img width=&amp;quot;689&amp;quot; height=&amp;quot;622&amp;quot; src=&amp;quot;http://dev.meotom.net/Uploads/admin/2010/6/14/ScreenHunter_016.gif&amp;quot; alt=&amp;quot;&amp;quot; /&amp;gt;&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;T&amp;amp;igrave;m đến Application Server --&amp;amp;gt; Detail --&amp;amp;gt; Internet Information Services (IIS) --&amp;amp;gt; Detail --&amp;amp;gt; chọn World Wide Web Service --&amp;amp;gt; Detail --&amp;amp;gt; Chọn Active Server Pages --&amp;amp;gt; OK --&amp;amp;gt; Next tiếp để HDH cấu h&amp;amp;igrave;nh lại IIS cho bạn v&amp;amp;agrave; sau đ&amp;amp;oacute; bạn thử lại B3&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;&amp;lt;span style=&amp;quot;color: rgb(255, 0, 0);&amp;quot;&amp;gt;Ch&amp;amp;uacute; &amp;amp;yacute;: T&amp;amp;ecirc;n miền bạn tạo ở đ&amp;amp;acirc;y chỉ c&amp;amp;oacute; &amp;amp;yacute; nghĩa tr&amp;amp;ecirc;n Local (PC của bạn + c&amp;amp;aacute;c m&amp;amp;aacute;y kh&amp;amp;aacute;c trong mạng LAN) kh&amp;amp;ocirc;ng c&amp;amp;oacute; &amp;amp;yacute; nghĩa đối với Internet.&amp;amp;nbsp;Nếu t&amp;amp;ecirc;n miền bạn đặt tại m&amp;amp;aacute;y tr&amp;amp;ugrave;ng với t&amp;amp;ecirc;n miền khi Public th&amp;amp;igrave; h&amp;amp;atilde;y x&amp;amp;oacute;a d&amp;amp;ograve;ng&amp;amp;nbsp;&amp;lt;/span&amp;gt;&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;127.0.0.1 &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;span style=&amp;quot;white-space: pre;&amp;quot; class=&amp;quot;Apple-tab-span&amp;quot;&amp;gt;	&amp;lt;/span&amp;gt;www.test.com&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;ở trong File Host để tr&amp;amp;aacute;nh HDH hiểu lầm.&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;&amp;lt;span style=&amp;quot;font-size: x-large;&amp;quot;&amp;gt;&amp;lt;a name=&amp;quot;Windows7&amp;quot;&amp;gt;Đối với Windows 7 + Vista + Server 2008&amp;lt;/a&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;B1: l&amp;amp;agrave;m tương tự &amp;lt;a href=&amp;quot;#B1_2003&amp;quot;&amp;gt;B1 b&amp;amp;ecirc;n tr&amp;amp;ecirc;n&amp;lt;/a&amp;gt;&amp;amp;nbsp;(ch&amp;amp;uacute; &amp;amp;yacute; với bạn phải Set quyền Write cho file Host nếu kh&amp;amp;ocirc;ng bạn sẽ kh&amp;amp;ocirc;ng Save được File n&amp;amp;agrave;y)&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;B2: bạn v&amp;amp;agrave;o Start --&amp;amp;gt; Run --&amp;amp;gt; inetmgr --&amp;amp;gt; Enter (h&amp;amp;atilde;y chắc rằng IIS của bạn đ&amp;amp;atilde; được c&amp;amp;agrave;i)&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;Click chuột phải v&amp;amp;agrave;o Sites --&amp;amp;gt; Add Web Site... --&amp;amp;gt; Site Name (vd: Test) --&amp;amp;gt; Trỏ Physical path đến thư mục website của bạn --&amp;amp;gt; phần Binding --&amp;amp;gt; Host name: --&amp;amp;gt; g&amp;amp;otilde; domain của bạn như B1 --&amp;amp;gt; OK&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;&amp;lt;img width=&amp;quot;661&amp;quot; height=&amp;quot;628&amp;quot; src=&amp;quot;http://dev.meotom.net/Uploads/admin/2010/6/14/B1.PNG&amp;quot; alt=&amp;quot;&amp;quot; /&amp;gt;&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;&amp;lt;img width=&amp;quot;276&amp;quot; height=&amp;quot;94&amp;quot; src=&amp;quot;http://dev.meotom.net/Uploads/admin/2010/6/14/B2.PNG&amp;quot; alt=&amp;quot;&amp;quot; /&amp;gt;&amp;amp;nbsp;&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;Click v&amp;amp;agrave;o Browse www.test.com on *:80 để chạy --&amp;amp;gt; v&amp;amp;agrave; đ&amp;amp;acirc;y l&amp;amp;agrave; kết quả&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;&amp;lt;img width=&amp;quot;367&amp;quot; height=&amp;quot;163&amp;quot; src=&amp;quot;http://dev.meotom.net/Uploads/admin/2010/6/14/B3.PNG&amp;quot; alt=&amp;quot;&amp;quot; /&amp;gt;&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;Ch&amp;amp;uacute;c bạn th&amp;amp;agrave;nh c&amp;amp;ocirc;ng !&amp;lt;/p&amp;gt;</Body><CommentEnabled>True</CommentEnabled><ViewCount>0</ViewCount><ReleaseDate>6/14/2010 3:05:11 AM</ReleaseDate><TotalComment>0</TotalComment><IsMedia>False</IsMedia><IsPicture>True</IsPicture><IsVote>True</IsVote><ArticlePassword /><PostVisible>0</PostVisible><ArticlePath>/2010/6/14/Chay-Web-Domain-ao-tren-Windows-Server-3A9</ArticlePath><Approved>True</Approved><ImagePath /><CategoryId>23</CategoryId><ArrayCatID>23|0</ArrayCatID></Article></Articles>